package cn.ilovese.collect.controller.follow;

import cn.ilovese.collect.po.user.User;
import cn.ilovese.collect.service.follow.FollowService;
import cn.ilovese.collect.vo.ResultVO;
import cn.ilovese.collect.vo.follow.FollowGroupVO;
import cn.ilovese.collect.vo.user.UserVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/follow")
public class FollowController {
    @Resource
    FollowService followService;

    @PostMapping("/follow")
    public ResultVO<Integer> follow(@RequestBody FollowGroupVO followGroupVO){
        return followService.batchFollow(followGroupVO);
    }

    @PostMapping("/unfollow")
    public ResultVO<Integer> unfollow(@RequestBody FollowGroupVO followGroupVO){
        return followService.batchUnfollow(followGroupVO);
    }

    @GetMapping("/getFollows")
    public ResultVO<List<UserVO>> getFollowingsByUserId(@RequestParam Integer userId){
        return followService.getFollowingsByWorkerId(userId);
    }

//    @GetMapping("/getFollowers")
//    public Integer getNumOfFollows(@RequestParam Integer userId){
//        return followService.getNumOfFollowers(userId);
//    }

}
